import mongoose from "mongoose";

const noteSchema = mongoose.Schema({
  id: String, // 记录id
  title: String,
  content: String,
  tag: String,
  weather: String,
  week: String, 
  collect: {  // true: 收藏, false 未收藏
    type: Boolean,
    default: false,
  },
  user_id: {
    type: String,
    ref: 'User',
    required: true
  }
}, {
  timestamps: true
});

const Note = mongoose.model("Note", noteSchema);

export { Note, noteSchema };